using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace Jbe.CABExtension.SmartPartInfos
{
    public class TabLocationShowStrategy : IShowStrategy
    {
        private Control beforeSmartPart;

        public Control BeforeSmartPart
        {
            get { return beforeSmartPart; }
            set { beforeSmartPart = value; }
        }

        public TabLocationShowStrategy(Control beforeSmartPart)
        {
            this.beforeSmartPart = beforeSmartPart;
        }

        void IShowStrategy.Show(IDockPanelWorkspace workspace, IDockContent content)
        {
            IDockContent beforeContent = workspace.GetDockContent(BeforeSmartPart);
            content.DockHandler.Show(beforeContent.DockHandler.Pane, beforeContent);
        }
    }
}
